/*
 * To change super license header, choose License Headers in Project Properties.
 * To change super template file, choose Tools | Templates
 * and open the template in the editor.
 */

package GearCommands;

import java.util.HashMap;

/**
 * Static hash to index to user commands used on gear.
 *
 * @author Davi Mendes
 */
public class GearHashCommand extends HashMap<String, GearCommand> {

    /**
     * GearHashCommand constructor.
     */
    public GearHashCommand() {
        super(20);

        //External commands
        super.put("lspeers", new GearCommandLsPeers());
        super.put("lsx", new GearCommandLsX());
        super.put("movx", new GearCommandMovX());

        //Local commands
        super.put("ls", new GearCommandLs());
        super.put("new", new GearCommandNew());
        super.put("rm", new GearCommandRm());
        super.put("move", new GearCommandMove());
        super.put("copy", new GearCommandCopy());
        super.put("edit", new GearCommandEdit());
        super.put("clear", new GearCommandClear());

        //Control commands
        super.put("exit", new GearCommandExit());

        //Connection commands
        super.put("startastracker", new GearCommandStartAsTracker());
        super.put("startaspeer", new GearCommandStartAsPeer());
    }

    /**
     * Put operations not allowed on GearHashCommand. IllegalAccessError will be thrown.
     *
     * @param key   not allowed.
     * @param value not allowed.
     *
     * @return not allowed.
     */
    @Override
    public GearCommand put(String key, GearCommand value) {
        throw new IllegalAccessError("Operation not allowed to GearHashCommand");
    }

}
